﻿//INSTANT C# NOTE: Formerly VB.NET project-level imports:
using System.Linq;
using System.Xml.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Shapes;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;

using System.Collections.ObjectModel;

namespace DataBinding
{
	public partial class BindingsSetInCode
	{


		private void BindingsSetInCode_Loaded(object sender, System.Windows.RoutedEventArgs e)
		{

			this.txtFirstName.SetBinding(TextBox.TextProperty, new Binding("FirstName"));

			Binding b = new Binding();
			b.Path = new PropertyPath("LastName");
			this.txtLastName.SetBinding(TextBox.TextProperty, b);

			b = new Binding();
			b.Path = new PropertyPath("Birthday");
			b.StringFormat = "d";
			b.TargetNullValue = string.Empty;
			this.txtBirthday.SetBinding(TextBox.TextProperty, b);


			this.DataContext = Data.People;

		}

	public BindingsSetInCode()
	{

//INSTANT C# NOTE: Converted event handler wireups:
		this.Loaded += new System.Windows.RoutedEventHandler(BindingsSetInCode_Loaded);
	}
	}

} //end of root namespace